﻿<%@ Page Title="" Language="VB" MasterPageFile="~/MainLayout.master" AutoEventWireup="false"
    CodeFile="rtrans.aspx.vb" Inherits="rtrans" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<script type="text/javascript" src="scripts/overlib.js"></script>
    <h1>
        Property Transact(Rent)</h1>
    <hr />
    <asp:Label ID="lblStaffUID" runat="server" Visible="false" />
    <asp:Label ID="lblTransUID" runat="server" Visible="false" />
    <asp:Label ID="lblStaffType" runat="server" Visible="false" />
   <div  runat="server" id="divError" class="msg-box-error" visible="false" enableviewstate="false">
    
        <span class="title">Error</span><br />
        <asp:Label ID="lblMsgError" runat="server" Text="ERROR" />
        </div>
<div  runat="server" id="divSuccessful" class="msg-box-success" visible="false" enableviewstate="false">
    
        <span class="title">Successful</span><br />
        <asp:Label ID="lblMsgSuccessful" runat="server" Text="Success" />
    
</div>
    <p><%--Description of the page--%></p>
    <div class="General-info-Container">
        <table cellpadding="0" cellspacing="5" width="100%">
            <tr>
                <td colspan="2">
                    <table width="100%"><tr><td class="General-info-title" style="width:150px;"><h3>General Information</h3></td><td><div class="General-info-title-line"></div></td></tr></table>
                </td>
            </tr>
            <tr valign="top">
                <td valign="top"  >
                    <div>
                        <asp:UpdatePanel ID="udpContentGeneral" runat="server">
                            <ContentTemplate>
                                <table class="General-info-table " id="divContentGeneral" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <th scope="row" style="width: 250px">
                                            Transact As :
                                        </th>
                                        <td>
                                            <asp:RadioButtonList ID="rbtTransactAs" runat="server" RepeatDirection="Horizontal"
                                                AutoPostBack="true">
                                                <%--  <asp:ListItem Text="SR" Value="1" />
                                    <asp:ListItem Text="SC" Value="2" />
                                    <asp:ListItem Text="SL" Value="3" />
                                    <asp:ListItem Text="SI" Value="4" />--%>
                                            </asp:RadioButtonList>
                                            <span style="color: Red">*</span>
                                            <asp:RequiredFieldValidator ID="rfvrbtTransactAs" ControlToValidate="rbtTransactAs"
                                                SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                                ForeColor="Red" Display="Dynamic" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <th scope="row">
                                            Open File Number :
                                        </th>
                                        <td>
                                            <asp:Label ID="txtOpenFileNumber" runat="server" Font-Size="12px" />
                                        </td>
                                    </tr>
                                    <%-- Remove @ 6/5/2011 as this will only update after the money collected --%>
                                    <%-- <tr>
                            <th scope="row">
                                Invoice Number :
                            </th>
                            <td>
                                <asp:Label ID="txtInvoiceNumber" runat="server" />
                            </td>
                         </tr>--%>
                                    <tr>
                                        <th scope="row">
                                            List By :
                                        </th>
                                        <td>
                                            <asp:Label ID="lblLister" runat="server" Font-Size="12px" /><asp:Label ID="lblhidListerID" runat="server"
                                                Visible="false" Font-Size="12px" />
                                        </td>
                                    </tr> 
                                    <tr>
                                        <th scope="row">
                                            Transact By :
                                        </th>
                                        <td>
                                            <asp:Label ID="lblTransactor" runat="server" Font-Size="12px" />
                                        </td>
                                    </tr>                                   
                                    <tr id="trProjectName" runat="server">
                                        <th scope="row">
                                            Project Name :
                                        </th>
                                        <td>
                                            <asp:Label ID="txtProjectName" runat="server" Font-Size="12px" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <th scope="row">
                                            Premise Name :
                                        </th>
                                        <td>
                                            <asp:Label ID="txtPremiseName" runat="server" Font-Size="12px" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <th scope="row">
                                            List Date :
                                        </th>
                                        <td>
                                            <asp:Label ID="txtListDate" runat="server" Font-Size="12px" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <th scope="row">
                                            Transact Date :
                                        </th>
                                        <td>
                                            <asp:Label ID="lblTransactDate" runat="server" Font-Size="12px" />
                                        </td>
                                    </tr>
                                </table>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                  
                </td>
            </tr>
        </table>
    </div>
    <asp:UpdateProgress ID="upgContentGeneral" runat="server" AssociatedUpdatePanelID="udpContentGeneral">
        <ProgressTemplate>
            <div style="top: 0px; position: fixed; width: 100%; text-align: center">
                <span style="background-color: Yellow; font-weight: bold">Loading ...</span>
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <div class="General-info-Container">
        <table cellpadding="0" cellspacing="5" width="100%">
            <tr>
                <td colspan="2">
                    <table width="100%"><tr><td class="General-info-title" style="width:150px;"><h3>Rent Informations</h3></td><td><div class="General-info-title-line"></div></td></tr></table>
                </td>
            </tr>
            <tr valign="top">
                <td valign="top" >
                    <div>
                        <table class="General-info-table " id="Table1" cellpadding="0" cellspacing="0">
                            <tr>
                                <th scope="row" style="width: 250px" >
                                    Monthly Rental :
                                </th>
                                <td>
                                    <asp:TextBox ID="txtMonthlyRental" runat="server" onkeypress="return isNumberKey(event)"
                                        onpaste="return false;" />
                                    <span style="color: Red">*</span>
                                    <asp:RequiredFieldValidator ID="rfvtxtMonthlyRental" ControlToValidate="txtMonthlyRental"
                                        SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                        ForeColor="Red" Display="Dynamic" />
                                </td>
                            </tr>
                            <tr id="TRProject" runat="server">
                                <th scope="row">
                                    Duration of Tenancy :
                                </th>
                                <td>
                                    <asp:TextBox ID="txtDurationOfTenancy" runat="server" onkeypress="return isNumberKey(event)"
                                        onpaste="return false;" />
                                    <asp:DropDownList ID="ddlModeOfPayment" runat="server">
                                        <asp:ListItem Text="Year(s)" Value="0" />
                                        <asp:ListItem Text="Month(s)" Value="1" />
                                        <asp:ListItem Text="Day(s)" Value="2" />
                                    </asp:DropDownList>
                                    <span style="color: Red">*</span>
                                    <asp:RequiredFieldValidator ID="rfvtxtDurationOfTenancy" ControlToValidate="txtDurationOfTenancy"
                                        SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                        ForeColor="Red" Display="Dynamic" />
                                    <asp:RequiredFieldValidator ID="rfvddlModeOfPayment" ControlToValidate="ddlModeOfPayment"
                                        SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                        ForeColor="Red" Display="Dynamic" />
                                </td>
                            </tr>
                            <tr>
                                <th scope="row">
                                    Use of Premis :
                                </th>
                                <td>
                                    <asp:DropDownList ID="ddlUseOfPremis" runat="server">
                                        <asp:ListItem Text="-SELECT-" Value="" />
                                        <asp:ListItem Text="Residential" Value="0" />
                                        <asp:ListItem Text="Commercial" Value="1" />
                                        <asp:ListItem Text="Land" Value="2" />
                                        <asp:ListItem Text="Industrial" Value="3" />
                                        <asp:ListItem Text="Agriculture" Value="4" />
                                    </asp:DropDownList>
                                    <span style="color: Red">*</span>
                                    <asp:RequiredFieldValidator ID="rfvddlUseOfPremis" ControlToValidate="ddlUseOfPremis"
                                        SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                        ForeColor="Red" Display="Dynamic" />
                                </td>
                            </tr>
                            <tr>
                                <th scope="row">
                                    Requisition :
                                </th>
                                <td>
                                    <asp:TextBox ID="txtRequisition" runat="server" TextMode="MultiLine" Rows="4" />
                                    <span style="color: Red">*</span>
                                    <asp:RequiredFieldValidator ID="rfvtxtRequisition" ControlToValidate="txtRequisition"
                                        SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                        ForeColor="Red" Display="Dynamic" />
                                </td>
                            </tr>
                            <tr>
                                <th scope="row">
                                    Termination Clause :
                                </th>
                                <td>
                                    <asp:TextBox ID="txtTerminationClause" runat="server" TextMode="MultiLine" Rows="4" />
                                    <span style="color: Red">*</span>
                                    <asp:RequiredFieldValidator ID="rfvtxtTerminationClause" ControlToValidate="txtTerminationClause"
                                        SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                        ForeColor="Red" Display="Dynamic" />
                                </td>
                            </tr>
                            <tr id="CoBroke" runat="server">
                                <th scope="row">
                                    Co-Broke :
                                </th>
                                <td>
                                    <asp:Label ID="lblCoBroke" runat="server" onmouseout="return nd();" style="cursor: pointer;" font-size="12px" />                                    
                                    <%--co-broke details--%>
                                    <asp:Label ID="lblhidCoBrokeId" runat="server" Visible="false" font-size="12px"  />
                                    <asp:Label ID="lblhidCoBrokeAgencyName" runat="server" Visible="false" font-size="12px"  />
                                    <asp:Label ID="lblhidCoBrokePhone" runat="server" Visible="false" font-size="12px"  />
                                    <asp:Label ID="lblhidCoBrokeMobile" runat="server" Visible="false" font-size="12px"  />
                                    <asp:Label ID="lblhidCoBrokeFax" runat="server" Visible="false" font-size="12px"  />
                                    <asp:Label ID="lblhidCoBrokeEmail" runat="server" Visible="false" font-size="12px"  />
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                 
                </td>
            </tr>
        </table>
    </div>
    <div class="General-info-Container">
        <table cellpadding="0" cellspacing="0" width="100%">
            <%--<tr><td colspan="2"><div class="General-info-title"><h3>Particular</h3></div></td></tr>--%>
            <tr valign="top">
                <td style="width: 50%">
                    <table class="General-info-table " cellpadding="0" cellspacing="5" width="100%">
                        <tr>
                            <td colspan="2" style="padding-left:0px;">
                                

                                <table width="100%"><tr><td class="General-info-title" style="width:250px; padding-left:5px;"><h3>
                                    Landlord Information<asp:CheckBox ID="chkLandlordCompany" runat="server" Text="Company"
                                            Font-Bold="false" Font-Size="Small" ForeColor="Black" onClick="checkLandlordCompanyInfo()" /></h3></td><td><div class="General-info-title-line"></div></td></tr></table>
                            </td>
                        </tr>
                        <tr id="LName1" runat="server">
                            <th scope="row">
                                (1) Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtLandlordName1" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtLandlordName1" ControlToValidate="txtLandlordName1"
                                    SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr id="LName2" runat="server">
                            <th scope="row">
                                (2) Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtLandlordName2" runat="server" onkeyup="Validation('LName2')" />
                            </td>
                        </tr>
                        <tr id="LName3" runat="server">
                            <th scope="row">
                                (3) Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtLandlordName3" runat="server" onkeyup="Validation('LName3')" />
                            </td>
                        </tr>
                        <tr id="LComName" runat="server">
                            <th scope="row">
                                Company Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtLandlordCompanyName" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtLandlordCompanyName" ControlToValidate="txtLandlordCompanyName"
                                    SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr id="LIC1" runat="server">
                            <th scope="row">
                                (1) NRIC :
                            </th>
                            <td>
                                <asp:TextBox ID="txtLandlordNric1" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtLandlordNric1" ControlToValidate="txtLandlordNric1"
                                    SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr id="LIC2" runat="server">
                            <th scope="row">
                                (2) NRIC :
                            </th>
                            <td>
                                <asp:TextBox ID="txtLandlordNric2" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtLandlordNric2" ControlToValidate="txtLandlordNric2"
                                    runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr id="LIC3" runat="server">
                            <th scope="row">
                                (3) NRIC :
                            </th>
                            <td>
                                <asp:TextBox ID="txtLandlordNric3" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtLandlordNric3" ControlToValidate="txtLandlordNric3"
                                    runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr id="LCompanyNo" runat="server">
                            <th scope="row">
                                Company No :
                            </th>
                            <td>
                                <asp:TextBox ID="txtLandlordCompanyNo" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtLandlordCompanyNo" ControlToValidate="txtLandlordCompanyNo"
                                    SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Contact Person :
                            </th>
                            <td>
                                <asp:TextBox ID="txtLandlordContactPerson" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtLandlordContactPerson" ControlToValidate="txtLandlordContactPerson"
                                    SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Address :
                            </th>
                            <td>
                                <asp:TextBox ID="txtLandlordAddress" runat="server" TextMode="MultiLine" Height="100px" Rows="2" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Phone :
                            </th>
                            <td>
                                <asp:TextBox ID="txtLandlordPhone" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Fax :
                            </th>
                            <td>
                                <asp:TextBox ID="txtLandlordFax" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Mobile :
                            </th>
                            <td>
                                <asp:TextBox ID="txtLandlordMobile" runat="server" onkeypress="return isNumberKeyOnly(event)"
                                    onpaste="return false;" MaxLength="11" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtLandlordMobile" ControlToValidate="txtLandlordMobile"
                                    SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Email :
                            </th>
                            <td>
                                <asp:TextBox ID="txtLandlordEmail" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Income Tax No.
                            </th>
                            <td>
                                <asp:TextBox ID="txtLandlordIncomeTaxNo" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Viewing/Meeting/TeleConversation
                            </th>
                            <td>
                                <asp:TextBox ID="txtLandlordViewMeetTele" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th rowspan="row">
                                Referral :
                            </th>
                            <td>
                                <asp:DropDownList ID="ddlLandlordRefer" runat="server" onChange="checkLandlordRefer()">
                                    <asp:ListItem Text="No" Value="0" />
                                    <asp:ListItem Text="Yes" Value="1" />
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr id="LRefName" runat="server">
                            <th scope="row">
                                Referral Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtLandlordReferName" runat="server" />
                            </td>
                        </tr>
                        <tr id="LRefNRIC" runat="server">
                            <th scope="row">
                                Referral NRIC :
                            </th>
                            <td>
                                <asp:TextBox ID="txtLandlordReferNRIC" runat="server" />
                            </td>
                        </tr>
                        <tr id="LRefContact" runat="server">
                            <th scope="row">
                                Referral Contact :
                            </th>
                            <td>
                                <asp:TextBox ID="txtLandlordReferContact" runat="server" />
                            </td>
                        </tr>
                        <tr id="LRefStatus" runat="server">
                            <th scope="row">
                                Referral Status :
                            </th>
                            <td>
                                <asp:DropDownList ID="ddlLandlordReferStatus" runat="server" onChange="Calculation()">
                                    <asp:ListItem Text="From Landlord" Value="0" />
                                    <asp:ListItem Text="From Tenant" Value="1" />
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr id="LRefAmount" runat="server">
                            <th scope="row">
                                Referral Amount :
                            </th>
                            <td>
                                RM
                                <asp:TextBox ID="txtLandlordReferAmt" runat="server" Text="0.00" onkeyup="Calculation()"
                                    onkeypress="return isNumberKey(event)" onpaste="return false;" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtLandlordReferAmt" ControlToValidate="txtLandlordReferAmt"
                                    SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                    </table>
                </td>
                <td style="width: 50%">
                    <table class="General-info-table " cellpadding="0" cellspacing="5" width="100%">
                        <tr>
                            <td colspan="2" style="padding-left:0px;">
                               

                                <table width="100%"><tr><td class="General-info-title" style="width:250px;padding-left:5px;"><h3>
                                    Tenant Information<asp:CheckBox ID="chkTenantCompany" runat="server" Text="Company"
                                            Font-Bold="false" Font-Size="Small" ForeColor="Black" onClick="checkTenantCompanyInfo()" /></h3></td><td><div class="General-info-title-line"></div></td></tr></table>
                            </td>
                        </tr>
                        <tr id="TName1" runat="server">
                            <th scope="row">
                                (1) Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtTenantName1" runat="Server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtTenantName1" ControlToValidate="txtTenantName1"
                                    SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr id="TName2" runat="server">
                            <th scope="row">
                                (2) Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtTenantName2" runat="server" onkeyup="Validation('TName2')" />
                            </td>
                        </tr>
                        <tr id="TName3" runat="server">
                            <th scope="row">
                                (3) Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtTenantName3" runat="server" onkeyup="Validation('TName3')" />
                            </td>
                        </tr>
                        <tr id="TComName" runat="server">
                            <th scope="row">
                                Company Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtTenantCompanyName" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtTenantCompanyName" ControlToValidate="txtTenantCompanyName"
                                    SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr id="TIC1" runat="server">
                            <th scope="row">
                                (1) NRIC :
                            </th>
                            <td>
                                <asp:TextBox ID="txtTenantNric1" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtTenantNric1" ControlToValidate="txtTenantNric1"
                                    SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" />
                            </td>
                        </tr>
                        <tr id="TIC2" runat="server">
                            <th scope="row">
                                (2) NRIC :
                            </th>
                            <td>
                                <asp:TextBox ID="txtTenantNric2" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtTenantNric2" ControlToValidate="txtTenantNric2"
                                    runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr id="TIC3" runat="server">
                            <th scope="row">
                                (3) NRIC :
                            </th>
                            <td>
                                <asp:TextBox ID="txtTenantNric3" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtTenantNric3" ControlToValidate="txtTenantNric3"
                                    runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr id="TCompanyNo" runat="server">
                            <th scope="row">
                                Company No :
                            </th>
                            <td>
                                <asp:TextBox ID="txtTenantCompanyNo" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtTenantCompanyNo" ControlToValidate="txtTenantCompanyNo"
                                    SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Contact Person :
                            </th>
                            <td>
                                <asp:TextBox ID="txtTenantContact" runat="server" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtTenantContact" ControlToValidate="txtTenantContact"
                                    SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Address :
                            </th>
                            <td>
                                <asp:TextBox ID="txtTenantAddress" runat="server" TextMode="MultiLine" Height="100px" Rows="2" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Phone :
                            </th>
                            <td>
                                <asp:TextBox ID="txtTenantPhone" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Fax :
                            </th>
                            <td>
                                <asp:TextBox ID="txtTenantFax" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Mobile :
                            </th>
                            <td>
                                <asp:TextBox ID="txtTenantMobile" runat="server" onkeypress="return isNumberKeyOnly(event)"
                                    onpaste="return false;" MaxLength="11" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtTenantMobile" ControlToValidate="txtTenantMobile"
                                    SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Email :
                            </th>
                            <td>
                                <asp:TextBox ID="txtTenantEmail" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Income Tax No :
                            </th>
                            <td>
                                <asp:TextBox ID="txtTenantIncomeTax" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Viewing/Meeting/TeleConversation
                            </th>
                            <td>
                                <asp:TextBox ID="txtTenantViewMeetTele" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <th rowspan="row">
                                Referral :
                            </th>
                            <td>
                                <asp:DropDownList ID="ddlTenantRefer" runat="server" onChange="checkTenantRefer()">
                                    <asp:ListItem Text="No" Value="0" />
                                    <asp:ListItem Text="Yes" Value="1" />
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr id="TRefName" runat="server">
                            <th scope="row">
                                Referral Name :
                            </th>
                            <td>
                                <asp:TextBox ID="txtTenantReferName" runat="server" />
                            </td>
                        </tr>
                        <tr id="TRefNRIC" runat="server">
                            <th scope="row">
                                Referral NRIC :
                            </th>
                            <td>
                                <asp:TextBox ID="txtTenantReferNRIC" runat="server" />
                            </td>
                        </tr>
                        <tr id="TRefContact" runat="server">
                            <th scope="row">
                                Referral Contact :
                            </th>
                            <td>
                                <asp:TextBox ID="txtTenantReferContact" runat="server" />
                            </td>
                        </tr>
                        <tr id="TRefStatus" runat="server">
                            <th scope="row">
                                Referral Status :
                            </th>
                            <td>
                                <asp:DropDownList ID="ddlTenantReferStatus" runat="server" onChange="Calculation()">
                                    <asp:ListItem Text="From Tenant" Value="0" />
                                    <asp:ListItem Text="From Landlord" Value="1" />
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr id="TRefAmount" runat="server">
                            <th scope="row">
                                Referral Amount :
                            </th>
                            <td>
                                RM<asp:TextBox ID="txtTenantReferAmt" runat="server" Text="0.00" onkeyup="Calculation()"
                                    onkeypress="return isNumberKey(event)" onpaste="return false;" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtTenantReferAmt" ControlToValidate="txtTenantReferAmt"
                                    SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" Enabled="false" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                </td>
            </tr>
        </table>
    </div>
    <asp:UpdatePanel ID="updStampDuty" runat="server">
    <ContentTemplate>
    <div class="General-info-Container">
        <table cellpadding="0" cellspacing="0" width="100%">
            <tr valign="top">
                <td style="width: 50%">
                    <table class="General-info-table " cellpadding="0" cellspacing="5" width="100%">
                        <tr>
                            <td colspan="2" style="padding:0px;">
                                <table width="100%"><tr><td class="General-info-title" style="width:150px; padding-left:5px;"><h3>Landlord Fees</h3></td><td><div class="General-info-title-line"></div></td></tr></table>
                            </td>
                        </tr>
                        <tr>
                            <th scope="row" style="width: 180px">
                                Agency Fee :
                            </th>
                            <td>
                                RM<asp:TextBox ID="txtLandlordAgencyFee" runat="server" Text="0.00" onkeyup="Calculation()"
                                    onkeypress="return isNumberKey(event)" onpaste="return false;" />
                                &nbsp;+&nbsp;
                                <asp:TextBox ID="txtLandlordGst" runat="Server" Text="0.00" onkeyup="Calculation()"
                                    onkeypress="return isNumberKey(event)" onpaste="return false;" />
                                &nbsp;% GST&nbsp;<asp:CheckBox ID="chkLandlordGstPaid" runat="Server" Text="Paid By Landlord"
                                    onClick="Calculation()" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtLandlordAgencyFee" ControlToValidate="txtLandlordAgencyFee"
                                    SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" />
                                <asp:RequiredFieldValidator ID="rfvtxtLandlordGst" ControlToValidate="txtLandlordGst"
                                    SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row" style="width: 180px">
                                Referral Amount :
                            </th>
                            <td>
                                RM
                                <asp:TextBox ID="lblLandlordReferralAmt" runat="server" BackColor="Transparent" 
                                    onKeyPress="javascript: return false;" onPaste="javascript: return false;" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row" style="width: 180px">
                                Listing Fee :
                            </th>
                            <td>
                                <asp:Label ID="lblListingPercent" runat="server"  Font-size="12px"/>%
                                <asp:Button ID="btnGetListingFee" runat="server" Text="Get Listing Fee" CssClass="search-btn" Width="100px" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row" style="width: 180px">
                                T/A Fee :
                            </th>
                            <td>
                                RM
                                <asp:TextBox ID="txtLandLordTAFee" runat="server" Text="0.00" onkeyup="Calculation()"
                                    onkeypress="return isNumberKey(event)" onpaste="return false;" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtLandlordTAFee" ControlToValidate="txtLandlordTAFee"
                                    SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" />
                            </td>
                        </tr>
                    </table>
                </td>
                <td style="width: 50%">
                    <table class="General-info-table " cellpadding="0" cellspacing="5" width="100%">
                        <tr>
                            <td colspan="2" style="padding:0px;">
                                <table width="100%"><tr><td class="General-info-title" style="width:150px; padding-left:5px;"><h3>Tenant Fees</h3></td><td><div class="General-info-title-line"></div></td></tr></table>
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Disbursement Fee :
                            </th>
                            <td>
                                RM<asp:TextBox ID="txtTenantDisbursement" runat="server" Text="0.00" onkeyup="Calculation()"
                                    onkeypress="return isNumberKey(event)" onpaste="return false;" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtTenantDisbursement" ControlToValidate="txtTenantDisbursement"
                                    SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Referral Amount :
                            </th>
                            <td>
                                RM<asp:TextBox ID="lblTenantReferralAmt" runat="server" BackColor="Transparent" 
                                    onKeyPress="javascript: return false;" onPaste="javascript: return false;" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                T/A Fee :
                            </th>
                            <td>
                                RM
                                <asp:TextBox ID="txtTenantTAFee" runat="server" Text="0.00" onkeyup="Calculation()"
                                    onkeypress="return isNumberKey(event)" onpaste="return false;" />
                                <span style="color: Red">*</span>
                                <asp:RequiredFieldValidator ID="rfvtxtTenantTAFee" ControlToValidate="txtTenantTAFee"
                                    SetFocusOnError="true" runat="server" ValidationGroup="rtrans" ErrorMessage="<br />Required"
                                    ForeColor="Red" Display="Dynamic" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                <asp:TextBox ID="txtTenantMonthValue" runat="server" Width="20px" Text="0.00" onkeypress="return isNumberKey(event)"
                                    onpaste="return false;" />Month(s) Deposit :
                            </th>
                            <td>
                                RM
                                <asp:TextBox ID="txtTenantMonthDeposit" runat="server" Text="0.00" onkeypress="return isNumberKey(event)"
                                    onpaste="return false;" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                <asp:TextBox ID="txtTenantAdvanceValue" runat="server" Width="20px" Text="0.00" onkeypress="return isNumberKey(event)"
                                    onpaste="return false;" />Month(s) Advance :
                            </th>
                            <td>
                                RM
                                <asp:TextBox ID="txtTenantAdvance" runat="server" Text="0.00" onkeypress="return isNumberKey(event)"
                                    onpaste="return false;" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Water/Electric :
                            </th>
                            <td>
                                RM
                                <asp:TextBox ID="txtTenantWaterElec" runat="server" Text="0.00" onkeypress="return isNumberKey(event)"
                                    onpaste="return false;" />
                            </td>
                        </tr>
                        <tr>
                            <th scope="row">
                                Tel :
                            </th>
                            <td>
                                RM
                                <asp:TextBox ID="txtTenantTel" runat="server" Text="0.00" onkeypress="return isNumberKey(event)"
                                    onpaste="return false;" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    <div class="General-info-Container">
        <table cellpadding="0" cellspacing="5" width="100%">
            <tr>
                <td colspan="2">
                    <table width="100%"><tr><td class="General-info-title" style="width:150px; padding-left:5px;"><h3>Fees Summary</h3></td><td><div class="General-info-title-line"></div></td></tr></table>
                </td>
            </tr>
            <tr valign="top">
                <td valign="top"  >
                    <div>
                        <table class="General-info-table " id="Table2" cellpadding="0" cellspacing="0">
                            <tr>
                                <th scope="row" style="width: 250px; height: 30px;">
                                    Total Agency Fee :
                                </th>
                                <td style="height: 30px">
                                    <asp:TextBox ID="lblTotalAgencyFee" runat="server" BackColor="Transparent" 
                                        onKeyPress="javascript: return false;" onPaste="javascript: return false;" />
                                </td>
                            </tr>
                            <tr>
                                <th scope="row">
                                    For Lister :
                                </th>
                                <td>
                                    <asp:TextBox ID="lblForLister" runat="server" BackColor="Transparent" 
                                        onKeyPress="javascript: return false;" onPaste="javascript: return false;" />
                                </td>
                            </tr>
                            <tr>
                                <th scope="row" style="height: 30px">
                                    For Referral :
                                </th>
                                <td style="height: 30px">
                                    <asp:TextBox ID="lblForReferral" runat="server" BackColor="Transparent" 
                                        onKeyPress="javascript: return false;" onPaste="javascript: return false;" />
                                </td>
                            </tr>
                            <tr>
                                <th scope="row">
                                    Stamp Duty :
                                </th>
                                <td align="center">                                    
                                         <asp:TextBox ID="lblStampDuty" runat="server" BackColor="Transparent" 
                                        onKeyPress="return isNumberKeyOnly(event);" onPaste="javascript: return false;" />&nbsp;<asp:Button
                                            ID="btnStampDuty" runat="server" Text="Get Stamp Duty" CssClass="search-btn" Width="100px" />                                   
                                </td>
                            </tr>
                            <tr>
                                <th scope="row">
                                    For Gorvement :
                                </th>
                                <td>
                                    <asp:TextBox ID="lblForGorv" runat="server" BackColor="Transparent" 
                                        onKeyPress="javascript: return false;" onPaste="javascript: return false;" />
                                </td>
                            </tr>
                            <tr>
                                <th scope="row">
                                    Total T/A Fee :
                                </th>
                                <td>
                                    <asp:TextBox ID="lblTotalTAFee" runat="server" BackColor="Transparent" 
                                        onKeyPress="javascript: return false;" onPaste="javascript: return false;" />
                                </td>
                            </tr>
                            <tr>
                                <th scope="row">
                                    Gross Amount :
                                </th>
                                <td>
                                    <asp:TextBox ID="lblGrossAmount" runat="server" BackColor="Transparent" 
                                        onKeyPress="javascript: return false;" onPaste="javascript: return false;" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="height: 30px">
                    
                </td>
            </tr>
        </table>
    </div>
    </ContentTemplate>
    </asp:UpdatePanel>  
    <div class="Confirmation-Container">

        <table width="100%" style="margin-left:0px;">
                        <tr>
                            <td><div class="General-info-title-line"></div></td>
                            <td style="width:190px;"> 
                                &nbsp;&nbsp; <asp:Button ID="btnBack" runat="server" Text="Back" CssClass="search-btn" Width="60px"/>
                                &nbsp;
                                <asp:Button ID="BtnSave" runat="server" Text="Save" ValidationGroup="rtrans" CssClass="search-btn" Width="80px" />
                                 <cc1:ConfirmButtonExtender ID="CBEBack" runat="server" TargetControlID="btnBack" />
                            </td>
                            <td style="width: 60px"><div class="General-info-title-line"></div></td>
                        </tr>
                    </table>
    </div>
    <%--hidden field--%>
    <asp:Label ID="lblhidPropertyId" runat="server" Visible="false" />
    <asp:Label ID="lblhidTransactorId" runat="server" Visible="false" />

    <script language="javascript" type="text/javascript">
function checkLandlordRefer() {
    var ddlLandlordRefer = document.getElementById('<%=ddlLandlordRefer.ClientID %>');
    var LRefName = document.getElementById('<%=LRefName.ClientID %>');
    var LRefNRIC = document.getElementById('<%=LRefNRIC.ClientID %>');
    var LRefContact = document.getElementById('<%=LRefContact.ClientID %>');
    var LRefStatus = document.getElementById('<%=LRefStatus.ClientID %>');
    var LRefAmount = document.getElementById('<%=LRefAmount.ClientID %>');

    if (ddlLandlordRefer.options[ddlLandlordRefer.selectedIndex].value=='1') {
        LRefName.style.display = "inline";
        LRefName.style.visibility = "visible";
        LRefNRIC.style.display = "inline";
        LRefNRIC.style.visibility = "visible";
        LRefContact.style.display = "inline";
        LRefContact.style.visibility = "visible";
        LRefStatus.style.display = "inline";
        LRefStatus.style.visibility = "visible";
        LRefAmount.style.display = "inline";
        LRefAmount.style.visibility = "visible";
    }
    else {
        LRefName.style.display = "none";
        LRefName.style.visibility = "hidden";
        LRefNRIC.style.display = "none";
        LRefNRIC.style.visibility = "hidden";
        LRefContact.style.display = "none";
        LRefContact.style.visibility = "hidden";
        LRefStatus.style.display = "none";
        LRefStatus.style.visibility = "hidden";
        LRefAmount.style.display = "none";
        LRefAmount.style.visibility = "hidden";        
    }
    }
    function checkTenantRefer(){
    var ddlTenantRefer = document.getElementById('<%=ddlTenantRefer.ClientID %>');
    var TRefName = document.getElementById('<%=TRefName.ClientID %>');
    var TRefNRIC = document.getElementById('<%=TRefNRIC.ClientID %>');
    var TRefContact = document.getElementById('<%=TRefContact.ClientID %>');
    var TRefStatus = document.getElementById('<%=TRefStatus.ClientID %>');
    var TRefAmount = document.getElementById('<%=TRefAmount.ClientID %>');
    
    if (ddlTenantRefer.options[ddlTenantRefer.selectedIndex].value=='1') {
        TRefName.style.display = "inline";
        TRefName.style.visibility = "visible";
        TRefNRIC.style.display = "inline";
        TRefNRIC.style.visibility = "visible";
        TRefContact.style.display = "inline";
        TRefContact.style.visibility = "visible";
        TRefStatus.style.display = "inline";
        TRefStatus.style.visibility = "visible"; 
        TRefAmount.style.display = "inline";
        TRefAmount.style.visibility = "visible";
    }
    else {
        TRefName.style.display = "none";
        TRefName.style.visibility = "hidden";
        TRefNRIC.style.display = "none";
        TRefNRIC.style.visibility = "hidden";
        TRefContact.style.display = "none";
        TRefContact.style.visibility = "hidden";
        TRefStatus.style.display = "none";
        TRefStatus.style.visibility = "hidden";     
        TRefAmount.style.display = "none";
        TRefAmount.style.visibility = "hidden";
    }
    }
    function checkLandlordCompanyInfo(){
    var chkLandlordCompany = document.getElementById('<%=chkLandlordCompany.ClientID %>');
    var LName1 = document.getElementById('<%=LName1.ClientID %>');
    var LName2 = document.getElementById('<%=LName2.ClientID %>');
    var LName3 = document.getElementById('<%=LName3.ClientID %>');
    var LComName = document.getElementById('<%=LComName.ClientID %>');
    var LIC1 = document.getElementById('<%=LIC1.ClientID %>');
    var LIC2 = document.getElementById('<%=LIC2.ClientID %>');
    var LIC3 = document.getElementById('<%=LIC3.ClientID %>');
    var LCompanyNo = document.getElementById('<%=LCompanyNo.ClientID %>');
    var LandlordName = document.getElementById('<%=rfvtxtLandlordName1.ClientID %>');
    var LandlordNRIC = document.getElementById('<%=rfvtxtLandlordNric1.ClientID %>');
    var LandlordCompanyName = document.getElementById('<%=rfvtxtLandlordCompanyName.ClientID %>');
    var LandlordCompanyNo = document.getElementById('<%=rfvtxtLandlordCompanyNo.ClientID %>');

    if (chkLandlordCompany.checked == true) {
        LComName.style.display = "inline";
        LComName.style.visibility = "visible";
        LCompanyNo.style.display = "inline";
        LCompanyNo.style.visibility = "visible";
        LName1.style.display = "none";
        LName1.style.visibility = "hidden";
        LName2.style.display = "none";
        LName2.style.visibility = "hidden";
        LName3.style.display = "none";
        LName3.style.visibility = "hidden";
        LIC1.style.display = "none";
        LIC1.style.visibility = "hidden";
        LIC2.style.display = "none";
        LIC2.style.visibility = "hidden"; 
        LIC3.style.display = "none";
        LIC3.style.visibility = "hidden"; 
        ValidatorEnable(LandlordCompanyName, true);
        ValidatorEnable(LandlordCompanyNo, true); 
        ValidatorEnable(LandlordName, false);
        ValidatorEnable(LandlordNRIC, false);     
    }
    else {
        LComName.style.display = "none";
        LComName.style.visibility = "hidden";
        LCompanyNo.style.display = "none";
        LCompanyNo.style.visibility = "hidden";
        LName1.style.display = "inline";
        LName1.style.visibility = "visible";
        LName2.style.display = "inline";
        LName2.style.visibility = "visible";
        LName3.style.display = "inline";
        LName3.style.visibility = "visible";
        LIC1.style.display = "inline";
        LIC1.style.visibility = "visible";
        LIC2.style.display = "inline";
        LIC2.style.visibility = "visible"; 
        LIC3.style.display = "inline";
        LIC3.style.visibility = "visible";  
        ValidatorEnable(LandlordName, true);
        ValidatorEnable(LandlordNRIC, true);
        ValidatorEnable(LandlordCompanyName, false);
        ValidatorEnable(LandlordCompanyNo, false);            
    }
    }
    function checkTenantCompanyInfo(){
    var chkTenantCompany = document.getElementById('<%=chkTenantCompany.ClientID %>');
    var TName1 = document.getElementById('<%=TName1.ClientID %>');
    var TName2 = document.getElementById('<%=TName2.ClientID %>');
    var TName3 = document.getElementById('<%=TName3.ClientID %>');
    var TComName = document.getElementById('<%=TComName.ClientID %>');
    var TIC1 = document.getElementById('<%=TIC1.ClientID %>');
    var TIC2 = document.getElementById('<%=TIC2.ClientID %>');
    var TIC3 = document.getElementById('<%=TIC3.ClientID %>');
    var TCompanyNo = document.getElementById('<%=TCompanyNo.ClientID %>');
    var TenantName = document.getElementById('<%=rfvtxtTenantName1.ClientID %>');
    var TenantNRIC = document.getElementById('<%=rfvtxtTenantNric1.ClientID %>');
    var TenantCompanyName = document.getElementById('<%=rfvtxtTenantCompanyName.ClientID %>');
    var TenantCompanyNo = document.getElementById('<%=rfvtxtTenantCompanyNo.ClientID %>');

    if (chkTenantCompany.checked == true) {
        TComName.style.display = "inline";
        TComName.style.visibility = "visible";
        TCompanyNo.style.display = "inline";
        TCompanyNo.style.visibility = "visible";
        TName1.style.display = "none";
        TName1.style.visibility = "hidden";
        TName2.style.display = "none";
        TName2.style.visibility = "hidden";
        TName3.style.display = "none";
        TName3.style.visibility = "hidden";
        TIC1.style.display = "none";
        TIC1.style.visibility = "hidden";
        TIC2.style.display = "none";
        TIC2.style.visibility = "hidden"; 
        TIC3.style.display = "none";
        TIC3.style.visibility = "hidden"; 
        ValidatorEnable(TenantCompanyName, true);
        ValidatorEnable(TenantCompanyNo, true);
        ValidatorEnable(TenantName, false);
        ValidatorEnable(TenantNRIC, false);    
    }
    else {
        TComName.style.display = "none";
        TComName.style.visibility = "hidden";
        TCompanyNo.style.display = "none";
        TCompanyNo.style.visibility = "hidden";
        TName1.style.display = "inline";
        TName1.style.visibility = "visible";
        TName2.style.display = "inline";
        TName2.style.visibility = "visible";
        TName3.style.display = "inline";
        TName3.style.visibility = "visible";
        TIC1.style.display = "inline";
        TIC1.style.visibility = "visible";
        TIC2.style.display = "inline";
        TIC2.style.visibility = "visible"; 
        TIC3.style.display = "inline";
        TIC3.style.visibility = "visible";
        ValidatorEnable(TenantName, true);
        ValidatorEnable(TenantNRIC, true); 
        ValidatorEnable(TenantCompanyName, false);
        ValidatorEnable(TenantCompanyNo, false);    
    }
    }
    function Calculation() {
    var ddlLandlordReferStatus = document.getElementById('<%=ddlLandlordReferStatus.ClientID %>');
    var txtLandlordReferAmt = document.getElementById('<%=txtLandlordReferAmt.ClientID %>');
    var lblLandlordReferralAmt = document.getElementById('<%=lblLandlordReferralAmt.ClientID %>');
    var ddlTenantReferStatus = document.getElementById('<%=ddlTenantReferStatus.ClientID %>');
    var txtTenantReferAmt = document.getElementById('<%=txtTenantReferAmt.ClientID %>');
    var lblTenantReferralAmt = document.getElementById('<%=lblTenantReferralAmt.ClientID %>');
    var lblForReferral = document.getElementById('<%=lblForReferral.ClientID %>');
    var txtLandlordAgencyFee = document.getElementById('<%=txtLandlordAgencyFee.ClientID %>');
    var txtLandlordGsts = document.getElementById('<%=txtLandlordGst.ClientID %>');
    var chkLandlordGstPaid = document.getElementById('<%=chkLandlordGstPaid.ClientID %>');
    var lblTotalAgencyFee = document.getElementById('<%=lblTotalAgencyFee.ClientID %>');
    var lblForGorv = document.getElementById('<%=lblForGorv.ClientID %>');
    var lblForLister = document.getElementById('<%=lblForLister.ClientID %>');
    var lblGrossAmount = document.getElementById('<%=lblGrossAmount.ClientID %>');
    var lblListingPercent = document.getElementById('<%=lblListingPercent.ClientID %>');
    var txtTenantDisbursement = document.getElementById('<%=txtTenantDisbursement.ClientID %>');
    var lblTotalTAFee = document.getElementById('<%=lblTotalTAFee.ClientID %>');
    var txtTenatTAFee = document.getElementById('<%=txtTenantTAFee.ClientID %>');
    var txtLandlordTAFee = document.getElementById('<%=txtLandlordTAFee.ClientID %>');
    var lblStampDuty = document.getElementById('<%=lblStampDuty.ClientID %>');
    //Referral Summary    
    if (ddlLandlordReferStatus.options[ddlLandlordReferStatus.selectedIndex].value=='0' && ddlTenantReferStatus.options[ddlTenantReferStatus.selectedIndex].value=='1'){
        var LandlordReferAmt = txtLandlordReferAmt.value;
        var TenantReferAmt = txtTenantReferAmt.value;
        var landlordReferralAmt = parseFloat(LandlordReferAmt.replace(",","")) + parseFloat(TenantReferAmt.replace(",",""));
        var TenantReferralAmt = parseFloat(0.00);
        lblLandlordReferralAmt.value = landlordReferralAmt.toFixed(2);
        lblTenantReferralAmt.value = TenantReferralAmt.toFixed(2);
    }
    else if (ddlLandlordReferStatus.options[ddlLandlordReferStatus.selectedIndex].value=='1' && ddlTenantReferStatus.options[ddlTenantReferStatus.selectedIndex].value=='0'){
        var LandlordReferAmt = txtLandlordReferAmt.value;
        var TenantReferAmt = txtTenantReferAmt.value;
        var TenantReferralAmt = parseFloat(LandlordReferAmt.replace(",","")) + parseFloat(TenantReferAmt.replace(",",""));
        var landlordReferralAmt = parseFloat(0.00);
        lblLandlordReferralAmt.value = landlordReferralAmt.toFixed(2);              
        lblTenantReferralAmt.value = TenantReferralAmt.toFixed(2);
    }
    else if (ddlLandlordReferStatus.options[ddlLandlordReferStatus.selectedIndex].value=='1' && ddlTenantReferStatus.options[ddlTenantReferStatus.selectedIndex].value=='1') {
        var LandlordReferAmt = txtLandlordReferAmt.value;
        var TenantReferAmt = txtTenantReferAmt.value;
        var TenantReferralAmt = parseFloat(LandlordReferAmt.replace(",",""));
        var landlordReferralAmt = parseFloat(TenantReferAmt.replace(",",""));
        lblLandlordReferralAmt.value = landlordReferralAmt.toFixed(2);              
        lblTenantReferralAmt.value = TenantReferralAmt.toFixed(2);
    }
    else {
        var LandlordReferAmt = txtLandlordReferAmt.value;
        var TenantReferAmt = txtTenantReferAmt.value;
        var landlordReferralAmt = parseFloat(LandlordReferAmt.replace(",",""));
        var TenantReferralAmt = parseFloat(TenantReferAmt.replace(",",""));
        lblLandlordReferralAmt.value = landlordReferralAmt.toFixed(2);
        lblTenantReferralAmt.value = TenantReferralAmt.toFixed(2);
    }
    //For Gov
    var LandlordGsts = txtLandlordGsts.value;
    var LandlordAgencyFee = txtLandlordAgencyFee.value;
    var GST = (parseFloat(LandlordGsts.replace(",","")) / 100) * parseFloat(LandlordAgencyFee.replace(",",""));    
    lblForGorv.value = GST.toFixed(2);
    //Total Agency Fee = Agency Fee + Disbursement Fee
    if (chkLandlordGstPaid.checked == '1') {
        var LandlordAgencyFeeVal = txtLandlordAgencyFee.value;
        var TenantDisbursement = txtTenantDisbursement.value;
        var TotalAgencyFee = parseFloat(LandlordAgencyFeeVal.replace(",","")) + parseFloat(TenantDisbursement.replace(",",""));      
        lblTotalAgencyFee.value = TotalAgencyFee.toFixed(2);
    }
    else {
        var LandlordAgencyFeeVal = txtLandlordAgencyFee.value;
        var TenantDisbursement = txtTenantDisbursement.value;   
        var TotalAgencyFee = parseFloat(LandlordAgencyFeeVal.replace(",","")) + parseFloat(TenantDisbursement.replace(",","")) - parseFloat(GST);
        lblTotalAgencyFee.value = TotalAgencyFee.toFixed(2);
    }
    //For Referral
    var Referral = landlordReferralAmt + TenantReferralAmt;
    lblForReferral.value = Referral.toFixed(2);   
    //For Lister
    ///var Lister = (TotalAgencyFee - Referral)*(parseFloat(lblListingPercent.innerHTML) / 100);
    ///lblForLister.value = Lister.toFixed(2);
    ///Edited by minginn @ 16/11/2011 - To only take landlord AgencyFee and landlord Referrral in calculation of lister fee
     if (chkLandlordGstPaid.checked == '1') {   
        var LandlordAgencyFeeVal = txtLandlordAgencyFee.value;
        var LandlordAgencyFee = parseFloat(LandlordAgencyFeeVal.replace(",",""));
    }
    else {
        var LandlordAgencyFeeVal = txtLandlordAgencyFee.value;
        var LandlordAgencyFee = parseFloat(LandlordAgencyFeeVal.replace(",","")) - parseFloat(GST);        
    }
    var Lister = (LandlordAgencyFee - landlordReferralAmt)*(parseFloat(lblListingPercent.innerHTML) / 100);
    lblForLister.value = Lister.toFixed(2);
    //TA
    var LandlordTAFee = txtLandlordTAFee.value;
    var TenantTAFee = txtTenatTAFee.value;
    var TotalTAFee = parseFloat(LandlordTAFee.replace(",","")) + parseFloat(TenantTAFee.replace(",",""));
    lblTotalTAFee.value = TotalTAFee.toFixed(2);
    //Stamp Duty
    var StampDutyVal = lblStampDuty.value
    var StampDuty = parseFloat(StampDutyVal.replace(",",""));
    //For Gross Amount
    var GrossAmount = TotalAgencyFee + TotalTAFee - Referral; 
    lblGrossAmount.value = GrossAmount.toFixed(2);
    }  
    
    function Validation(field){
    var txtTenantName2 = document.getElementById('<%=txtTenantName2.ClientID %>');
    var rfvTenantNRIC2 = document.getElementById('<%=rfvtxtTenantNric2.ClientID %>');
    var txtTenantName3 = document.getElementById('<%=txtTenantName3.ClientID %>');
    var rfvTenantNRIC3 = document.getElementById('<%=rfvtxtTenantNric3.ClientID %>');
    var txtLandlordName2 = document.getElementById('<%=txtLandlordName2.ClientID %>');
    var rfvLandlordNRIC2 = document.getElementById('<%=rfvtxtLandlordNric2.ClientID %>');
    var txtLandlordName3 = document.getElementById('<%=txtLandlordName3.ClientID %>');
    var rfvLandlordNRIC3 = document.getElementById('<%=rfvtxtLandlordNric3.ClientID %>');
    if (field=='TName2') {
        if (txtTenantName2.value != '') {
            ValidatorEnable(rfvTenantNRIC2, true);
        }
        else {
            ValidatorEnable(rfvTenantNRIC2, false);
        } 
    }
    else if (field=='TName3') {
        if (txtTenantName3.value != '') {
            ValidatorEnable(rfvTenantNRIC3, true);
        }
        else {
            ValidatorEnable(rfvTenantNRIC3, false);
        } 
    }
    else if (field=='LName2') {
        if (txtLandlordName2.value != '') {
            ValidatorEnable(rfvLandlordNRIC2, true);
        }
        else {
            ValidatorEnable(rfvLandlordNRIC2, false);
        } 
    }
    else if (field=='LName3') {
        if (txtLandlordName2.value != '') {
            ValidatorEnable(rfvLandlordNRIC2, true);
        }
        else {
            ValidatorEnable(rfvLandlordNRIC2, false);
        } 
    }
    }  
    </script>

</asp:Content>
